package cn.donghuapian.controller;

import cn.donghuapian.entity.HistoryEntity;
import cn.donghuapian.service.IHistoryService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hzw
 * @since 2024-09-04
 */
@RestController
@RequestMapping("/history")
public class HistoryController {

    @Autowired
    private IHistoryService historyService;

//    @Autowired
//    private SambaService sambaService;

    @PostMapping("/list")
    public List<HistoryEntity> list() {
        return historyService.list();
    }

    @PostMapping("/page")
    public Page<HistoryEntity> page(@RequestBody Page<HistoryEntity> page) {
        return historyService.page(page);
    }

//    @PostMapping("/fileList")
//    public void fileList() {
//        sambaService.test();
//    }
//
//    @PostMapping("/upload")
//    public void upload(MultipartFile file, String fileName) {
//        sambaService.upload(file, fileName);
//    }

}
